<?php
require_once(dirname(__FILE__)."/../lib/Loader.php");
cfgload("defines");
cfgload("distr");
cload("Smarty.smartyRenderer");
cload("requestProcessor");
cload("kinopoisk.kinoPoiskFilm");
cload("distr.distrList");
/**
 * Description of distrList
 *
 * @author Di_Moon
 */
class distrList extends smartyRenderer {
    protected $_dbh;
    protected $_filmid;
    protected $_kinopoisk;
    
    function __construct($dbh) {
        parent::__construct();
        $this->_dbh = $dbh;
        
        $this->_filmid = requestProcessor::getVar("filmid", 0);
        $this->_kinopoisk = new kinoPoiskFilm($this->_dbh, $this->_filmid);
        
        $this->assign("distrForFilm", $this->_kinopoisk->filmPresent());
        $this->assign("kinopoisk", $this->_kinopoisk->getElements());
        $this->assign("filmid", $this->_filmid);
        $this->assign("distrTypes", _distr_invertTypes());
        $this->assign("distrStatutes", _distr_statusArray());
        
    }
    
    function render() {
        
        $list = new distributeList($this->_dbh, $this->_filmid);
        $this->assign("distrList", $list->getListArr());
        return $this->fetch("distrList.tpl");
    }
}

?>
